<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:t="http://www.pagac.cz/jsf"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
 <h:head></h:head>
 <h:body>
    <ui:composition template="/WEB-INF/templates/template-insystem.xhtml">

        <!-- Toolbar -->
        <ui:define name="toolbar-place">
            <t:toolbar>
                <t:icon iconName="home" action="goHome" label="#{msgs['toolbar.home']}" />
                <t:icon iconName="back" action="invoice/list" label="#{msgs['toolbar.back']}" />
                <t:icon iconName="print" action="printPage" label="#{msgs['toolbar.print']}" />
            </t:toolbar>
        </ui:define>

        <!-- Title -->
        <ui:define name="content-title">
            <h1>#{msgs["user.invoice.detail.title"]}</h1>
        </ui:define>

        <!-- Content -->
        <ui:define name="content">
            <c:if test="#{invoiceManager.invoice.idProject == -1}">
                <script type="text/javascript" language="JavaScript">
                   window.location="list.jsf";
                </script>
            </c:if>
            <br /><br />
            <h:outputStylesheet name="cssInvoice.css" library="css" />
            <h:outputLabel>#{msgs["user.invoice.detail.invoiceNumber"]}: #{invoiceManager.invoice.invoiceNumber}</h:outputLabel>
            <br /> <br /> <hr />
            <div>
            <div id="dodavatel">
                <h:outputLabel styleClass="lbl">#{msgs["user.invoice.detail.user"]}:</h:outputLabel><br /><br />
                <h:outputLabel styleClass="lbl">#{userManager.user.name}</h:outputLabel><br />
                <h:outputLabel styleClass="text">#{userManager.user.address}</h:outputLabel><br />
                <h:outputLabel styleClass="text">#{userManager.user.city}, #{userManager.user.zipCode}</h:outputLabel><br /><br />
                <h:outputLabel styleClass="text">#{msgs["customer.ic"]} #{userManager.user.ic}</h:outputLabel><br />
                <h:outputLabel styleClass="text">#{msgs["customer.dic"]} #{userManager.user.dic}</h:outputLabel><br /><br />
            </div>

            <div id="odberatel">
                <h:outputLabel styleClass="lbl">#{msgs["user.invoice.detail.customer"]}:</h:outputLabel><br /><br />
                <h:outputLabel styleClass="lbl">#{invoiceManager.customer.name}</h:outputLabel><br />
                <h:outputLabel styleClass="text">#{invoiceManager.customer.address}</h:outputLabel><br />
                <h:outputLabel styleClass="text">#{invoiceManager.customer.city}, #{invoiceManager.customer.zipCode}</h:outputLabel><br /><br />
                <h:outputLabel styleClass="text">#{msgs["customer.ic"]} #{invoiceManager.customer.ic}</h:outputLabel><br />
                <h:outputLabel styleClass="text">#{msgs["customer.dic"]} #{invoiceManager.customer.dic}</h:outputLabel><br /><br />
            </div>
            </div>

            <div id="datumy">

            <h:panelGrid columns="2">
                <h:outputLabel styleClass="lbl">#{msgs["user.invoice.detail.dateOfIssue"]}: </h:outputLabel>
                <h:outputLabel styleClass="text">#{invoiceManager.invoice.dateOfIssue}</h:outputLabel>

                <h:outputLabel styleClass="lbl">#{msgs["user.invoice.detail.dueDate"]}: </h:outputLabel>
                <h:outputLabel styleClass="text">#{invoiceManager.invoice.dueDate}</h:outputLabel>

                <h:outputLabel styleClass="lbl">#{msgs["user.invoice.detail.workDate"]}: </h:outputLabel>
                <h:outputLabel styleClass="text">#{invoiceManager.invoice.workDateFrom} - #{invoiceManager.invoice.workDateTo}</h:outputLabel>

                <h:outputLabel styleClass="lbl">#{msgs["user.invoice.detail.dateOfPayment"]}: </h:outputLabel>
                <h:outputLabel styleClass="text">#{invoiceManager.invoice.dateOfPayment}</h:outputLabel>

            </h:panelGrid>
            </div>
            <br /> 

            <table class="table">
                <tr style="height: 40px;">
                    <td class="tableLabel" style="width: 30%;">#{msgs["user.invoice.detail.item"]}</td>
                    <td class="tableLabel" style="width: 10%;">#{msgs["user.invoice.detail.units"]}</td>
                    <td class="tableLabel" style="width: 20%;">#{msgs["user.invoice.detail.pricePerRateUnit"]}</td>
                    <td class="tableLabel" style="width: 20%;">#{msgs["user.invoice.detail.withoutDPH"]}</td>
                    <td class="tableLabel" style="width: 20%;">#{msgs["user.invoice.detail.withDPH"]}</td>
                </tr>
                <tr style="height: 60px;">
                    <td class="tableText" style="width: 40%;">#{invoiceManager.project.name} -
                        <c:choose>
                            <c:when test="#{invoiceManager.invoice.rateType == 'p'}">
                                <h:outputLabel styleClass="text">#{msgs["user.invoice.detail.project"]}</h:outputLabel>
                            </c:when>
                            <c:when test="#{invoiceManager.invoice.rateType == 't'}">
                                <h:outputLabel styleClass="text">#{msgs["user.invoice.detail.tariff"]}</h:outputLabel>
                            </c:when>
                            <c:when test="#{invoiceManager.invoice.rateType == 'h'}">
                                <h:outputLabel styleClass="text">#{msgs["user.invoice.detail.hours"]}</h:outputLabel>
                            </c:when>
                        </c:choose>

                    </td>
                    <td class="tableText" style="width: 10%;">#{invoiceManager.invoice.units} #{msgs["app.metric"]}</td>
                    <td class="tableText" style="width: 10%;">#{invoiceManager.invoice.pricePerRateUnit} #{msgs["app.currency"]}</td>
                    <td class="tableText" style="width: 20%;">#{invoiceManager.withoutDph} #{msgs["app.currency"]}</td>
                    <td class="tableText" style="width: 20%; font-weight: bold;">#{invoiceManager.invoice.amount} #{msgs["app.currency"]}</td>
                </tr>
                <tr>
                    <td colspan ="3"></td>
                    <td class="tableTotal" style="border-top: 1px solid; border-left: 1px solid;">Celková cena bez DPH: </td>
                    <td class="tableTotal" style="border-top: 1px solid; text-align: center;">#{invoiceManager.withoutDph} #{msgs["app.currency"]}</td>
                </tr>
                <tr>
                    <td colspan ="3"></td>
                    <td class="tableTotal" style="border-left: 1px solid;">DPH: </td>
                    <td class="tableTotal" style="text-align: center;">#{invoiceManager.dph} #{msgs["app.currency"]}</td>
                </tr>
                <tr>
                    <td colspan ="3"></td>
                    <td class="tableTotal" style="border-left: 1px solid;">Částka k úhradě: </td>
                    <td class="tableTotal" style="text-align: center;">#{invoiceManager.invoice.amount} #{msgs["app.currency"]}</td>
                </tr>
            </table>
       </ui:define>

    </ui:composition>

</h:body>
</html>
